from django.urls import path
from rest_framework import routers

from . import views

urlpatterns = [
    path('authorizations/', views.MyObtainJSONWebToken.as_view()),
    path('statistical/day_active/', views.UserDailyActiveCountView.as_view()),
    path('statistical/day_orders/', views.UserDailyOrderCountView.as_view()),
    path('statistical/month_increment/', views.UserMonthCountView.as_view()),
    path('users/', views.UserListView.as_view()),
    path('permission/simple/', views.PermissionSimpleView.as_view()),
    path('permission/groups/simple/', views.GroupSimpleView.as_view()),
    path('skus/simple/', views.SKUSimpleView.as_view()),


]

# 1. 实例化路由对象
router = routers.DefaultRouter()
# 2. 注册路由
router.register('permission/perms', views.PermissionView, )
router.register('permission/groups', views.GroupView, )
router.register('permission/admins', views.AdminView, )
router.register('skus/images', views.ImageView, )
# 3. 把路由添加到urlpatterns上去
urlpatterns += router.urls
